﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:SchedulerControl="clr-namespace:SchedulerControl" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SchedulerControl.Adorners.Adorner" 
    Width="400" Height="300" >
    <Grid x:Name="gridControl" SizeChanged="gridControl_SizeChanged" RenderTransformOrigin="0.5,0.5">
        <Grid.Resources>
            <Style TargetType="Thumb" x:Key="ThumbResizeStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Margin" Value="-10" />
                <Setter Property="Width" Value="16" />
                <Setter Property="Height" Value="16" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="16" Height="16" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="Thumb" x:Key="ThumbResizeNoEdgeStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="Thumb" x:Key="ThumbRotateStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Margin" Value="-24" />
                <Setter Property="Width" Value="30" />
                <Setter Property="Height" Value="30" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="30" Height="30" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <!--<Grid x:Name="gridTransformed" >-->
            <Grid.RowDefinitions>
                <RowDefinition Height="0"/>
                <RowDefinition/>
                <RowDefinition Height="0"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0"/>
                <ColumnDefinition Width="20"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="0"/>
            </Grid.ColumnDefinitions>
            <Grid.RenderTransform>
                <TransformGroup>
                    <RotateTransform x:Name="trRotate" Angle="0" />
                    <TranslateTransform x:Name="trTranslate" X="100" Y="0" />
                </TransformGroup>
            </Grid.RenderTransform>
            <!-- adorner frame goes here -->
           

            <!--<Image Source="/TileMaster;component/Images/Hydrangeas.jpg" Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
               Grid.RowSpan="3" Grid.ColumnSpan="3"/>-->
            <Thumb x:Name="thumbMove" Grid.ColumnSpan="2" Margin="0" MouseMove="thumb_MouseMove" MouseLeftButtonUp="thumbMove_MouseLeftButtonUp"
                   DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted"
                   MouseEnter="thumb_MouseEnter" MouseLeave="thumb_MouseLeave" Cursor="None" Grid.Column="1" Grid.Row="1" >
                <Thumb.Template>
                    <ControlTemplate TargetType="Thumb">
                        <Rectangle Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="Transparent" />
                    </ControlTemplate>
                </Thumb.Template>
            </Thumb>

<!--            <Thumb x:Name="rotate00" Style="{StaticResource ThumbRotateStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" -->
<!--               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->

<!--            <Thumb x:Name="rotate01" Style="{StaticResource ThumbRotateStyle}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" -->
<!--               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->

<!--            <Thumb x:Name="rotate10" Style="{StaticResource ThumbRotateStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" -->
<!--               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->
<!---->
<!--            <Thumb x:Name="rotate11" Style="{StaticResource ThumbRotateStyle}" Grid.Column="2" Grid.Row="2"  HorizontalAlignment="Right" VerticalAlignment="Bottom" -->
<!--               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->
<!---->
<!---->
<!--            <Thumb x:Name="resize00" Style="{StaticResource ThumbResizeStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" -->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->
<!--            <Thumb x:Name="resize10" Style="{StaticResource ThumbResizeStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" -->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->

<!--            <Thumb x:Name="resize01" Style="{StaticResource ThumbResizeStyle}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" -->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->

<!--            <Thumb x:Name="resize11" Style="{StaticResource ThumbResizeStyle}" Grid.Column="2" Grid.Row="2"  HorizontalAlignment="Right" VerticalAlignment="Bottom" -->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->


            <Thumb x:Name="resizeTop" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
               Margin="6,-5,6,0" Height="16" Grid.ColumnSpan="2"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" Grid.Column="1" 
               />

            <Thumb x:Name="resizeBottom" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" 
               Margin="6,0,6,-5" Height="16" Grid.ColumnSpan="2"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" Grid.Column="1" Grid.Row="2" 
               />

    	

<!--            <Thumb x:Name="resizeLeft" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Left" VerticalAlignment="Stretch" -->
<!--               Margin="-10,6" Width="16" Grid.ColumnSpan="3" Grid.RowSpan="3"-->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->

<!--            <Thumb x:Name="resizeRight" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Right" VerticalAlignment="Stretch" -->
<!--               Margin="-10,6" Width="16" Grid.ColumnSpan="3" Grid.RowSpan="3"-->
<!--               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" -->
<!--               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" -->
<!--               />-->
<!--        </Grid>
        <TextBlock Grid.Row="1" Height="203" HorizontalAlignment="Left" Margin="-82,35,0,0" Name="info" Visibility="Collapsed"
                    Text="TextBlock" VerticalAlignment="Top" Width="336" IsHitTestVisible="False" Foreground="White"
                    Grid.ColumnSpan="2" />-->
        <Grid  Visibility="Collapsed" x:Name="topToolbar" Margin="0,-18,0,0" Opacity="1" Grid.ColumnSpan="2" Height="18" VerticalAlignment="Top" Grid.Column="1" MouseEnter="grid_MouseEnter"  MouseLeave="grid_MouseLeave" >
			<Rectangle HorizontalAlignment="Left" Width="46" RadiusX="5">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.513,-0.501" StartPoint="0.513,1.75">
						<GradientStop Color="#FF256BB6" Offset="0.51"/>
						<GradientStop Color="#FF4295D4" Offset="0.51"/>
						<GradientStop Color="#FF97B8F9"/>
						<GradientStop Color="#FF005DA3" Offset="1"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>

            <Button Name="btnClose" Content="Button" Style="{StaticResource MiniCloseButton}" VerticalAlignment="Top" Height="10" Width="10" d:LayoutOverrides="Width" Click="btnClose_Click" HorizontalAlignment="Left" Margin="4,4,0,0"/>
            <Button Name="btnEdit" Content="Button" Style="{StaticResource MiniEditButton}" Margin="18,4,0,0" VerticalAlignment="Top" Height="10" Width="10" d:LayoutOverrides="Width" Click="btnEdit_Click" HorizontalAlignment="Left"/>
            <Button Name="btnMaximize" Content="Button" Style="{StaticResource MiniMaximizeButton}" Margin="32,4,0,0" VerticalAlignment="Top" Width="10" Height="10" d:LayoutOverrides="Width" Click="btnMaximize_Click" HorizontalAlignment="Left"/>          


        </Grid>
		<Grid Visibility="Collapsed" x:Name="bottomToolbar" Margin="0,0,0,-18" Opacity="1" Grid.ColumnSpan="2" Height="18" VerticalAlignment="Bottom" Grid.Column="1" MouseEnter="grid_MouseEnter"  MouseLeave="grid_MouseLeave" Grid.Row="2" >
			<Rectangle HorizontalAlignment="Left" Width="46" RadiusX="5">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.513,-0.501" StartPoint="0.513,1.75">
						<GradientStop Color="#FF256BB6" Offset="0.51"/>
						<GradientStop Color="#FF4295D4" Offset="0.51"/>
						<GradientStop Color="#FF97B8F9"/>
						<GradientStop Color="#FF005DA3" Offset="1"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>

			<Button x:Name="btnClose1" Content="Button" Style="{StaticResource MiniCloseButton}" VerticalAlignment="Top" Height="10" Width="10" d:LayoutOverrides="Width" Click="btnClose_Click" HorizontalAlignment="Left" Margin="4,4,0,0"/>
			<Button x:Name="btnEdit1" Content="Button" Style="{StaticResource MiniEditButton}" Margin="18,4,0,0" VerticalAlignment="Top" Height="10" Width="10" d:LayoutOverrides="Width" Click="btnEdit_Click" HorizontalAlignment="Left"/>
			<Button x:Name="btnMaximize1" Content="Button" Style="{StaticResource MiniMaximizeButton}" Margin="32,4,0,0" VerticalAlignment="Top" Width="10" Height="10" d:LayoutOverrides="Width" Click="btnMaximize_Click" HorizontalAlignment="Left"/>          


		</Grid>
			
    </Grid>
	
</UserControl>
